package com.xhrd.framework.service;

import java.io.Serializable;
import java.util.List;

import com.xhrd.framework.dao.domain.BaseEntity;
import com.xhrd.framework.vo.Page;
import com.xhrd.framework.vo.SearchCondition;

/**
 *
 * @author 曹保利
 *
 * @param <Entity>
 * @param <SC>
 */
public interface EntityService<Entity extends BaseEntity, SC extends SearchCondition> extends BaseService {

    public Entity get(String id);

    public List<Entity> get(Serializable... ids);

    public Entity save(Entity entity);

    public Entity update(Entity entity);

    public List<Entity> search(SearchCondition searchCondition);

    public Entity searchUnique(SearchCondition searchCondition);

    public List<Entity> getAll();

    public boolean remove(Serializable id);

    public boolean remove(Serializable... ids);

    public boolean remove(Entity entity);

    /**
     * status变为-1
     *
     * @param id
     */
    public boolean logicRemove(Serializable id);

    public Page<Entity> searchPage(SearchCondition searchCondition);

    /**
     *
     * @param entity
     * @return 执行了更新则返回true,执行了新增则返回false
     */
    public boolean saveOrUpdate(Entity entity);

}
